<%--
  Created by IntelliJ IDEA.
  User: hatuo
  Date: 2019-04-21
  Time: 15:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    request.setAttribute("basePath", basePath);
%>
<html>
<head>
    <title>BUS</title>
    <link rel="stylesheet" href="${basePath}css/layui.css" media="all">
</head>
<body>
<button type="button" class="layui-btn layui-btn" id="importE">导入数据</button>
<%--<button type="button" class="layui-btn layui-btn" id="importC">导入BusCar</button>--%>
</body>
<script src="js/layui.all.js" charset="utf-8"></script>
<script>
    layui.use('upload', function () {
        var upload = layui.upload;
        upload.render({
            elem: '#importE',
            url: 'BusEServlet?action=upload',
            accept: 'file',
            drag: false,
            done: function (res) {
                alert('上传成功')
            }
        });
        // upload.render({
        //     elem: '#importC',
        //     url: 'BusCServlet?action=upload',
        //     accept: 'file',
        //     drag: false,
        //     done: function (res) {
        //         layer.msg('上传成功')
        //     }
        // });
    });
</script>
</html>
